package org.jsola.hr.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.core.Page;
import org.jsola.core.Result;
import org.jsola.hr.dto.CalculationRebatesDTO;
import org.jsola.hr.dto.SaleRebatesRecordAddDTO;
import org.jsola.hr.dto.SaleRebatesRecordUpdateDTO;
import org.jsola.hr.entity.CompanyDO;
import org.jsola.hr.query.SaleRebatesRecordQuery;
import org.jsola.hr.vo.*;

import java.util.List;

/**
 * 返费记录
 *
 * @author zhr
 */
@Api(tags = "hr-返费记录")
public interface ISaleRebatesRecordControllerAPI {

    /**
     * 新增返费记录
     *
     * @param saleRebatesRecordAddDTO 返费记录新增实体
     * @return 返费记录展示对象
     */
    @ApiOperation(value = "新增返费记录")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "saleRebatesRecordAddDTO", dataType = "SaleRebatesRecordAddDTO", value = "新增返费记录", paramType = "body")
    })
    Result<SaleRebatesRecordVO> save(SaleRebatesRecordAddDTO saleRebatesRecordAddDTO);


    /**
     * 修改返费记录
     *
     * @param saleRebatesRecordUpdateDTO 返费记录
     * @return 更新数量
     */
    @ApiOperation(value = "修改返费记录")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "saleRebatesRecordUpdateDTO", dataType = "SaleRebatesRecordUpdateDTO", value = "修改返费记录", paramType = "body")
    })
    Result<Integer> update(SaleRebatesRecordUpdateDTO saleRebatesRecordUpdateDTO);


    /**
     * 删除单个返费记录，彻底删除
     *
     * @param saleRebatesRecordId 返费记录id
     * @return 删除数量
     */
    @ApiOperation(value = "删除单个返费记录，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "saleRebatesRecordId", dataType = "String", value = "返费记录id", paramType = "path")
    })
    Result<Integer> delete(String saleRebatesRecordId);


    /**
     * 批量删除返费记录，彻底删除
     *
     * @param saleRebatesRecordIds 返费记录id集合
     * @return 删除数量
     */
    @ApiOperation(value = "批量删除返费记录，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "saleRebatesRecordIds", dataType = "String[]", value = "返费记录id数组", paramType = "body", allowMultiple = true)
    })
    Result<Integer> deleteBatch(String[] saleRebatesRecordIds);


    /**
     * 根据返费记录id查询返费记录详情
     *
     * @param saleRebatesRecordId 返费记录id
     * @return 返费记录详情
     */
    @ApiOperation(value = "根据返费记录id查询返费记录详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "saleRebatesRecordId", dataType = "String", value = "返费记录id", paramType = "path")
    })
    Result<SaleRebatesRecordVO> findById(String saleRebatesRecordId);


    /**
     * 查询返费记录
     *
     * @param saleRebatesRecordQuery 返费记录查询参数
     * @return page
     */
    @ApiOperation(value = "查询返费记录")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "saleRebatesRecordQuery", dataType = "SaleRebatesRecordQuery", value = "返费记录查询参数", paramType = "query")
    })
    Result<List<SaleRebatesRecordListVO>> listAll(SaleRebatesRecordQuery saleRebatesRecordQuery);


    /**
     * 分页查询返费记录
     *
     * @param saleRebatesRecordQuery 返费记录查询参数
     * @return page
     */
    @ApiOperation(value = "分页查询返费记录")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "saleRebatesRecordQuery", dataType = "SaleRebatesRecordQuery", value = "返费记录查询参数", paramType = "query")
    })
    Result<Page<SaleRebatesRecordListVO>> page(SaleRebatesRecordQuery saleRebatesRecordQuery);

    /**
     * 计算返费
     *
     * @param calculationRebatesDTO 计算返费参数
     * @return 计算结果
     */
    @ApiOperation(value = "计算返费")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "calculationRebatesDTO", dataType = "CalculationRebatesDTO", value = "返费参数", paramType = "body")
    })
    Result<CalculationRebatesVO> calculationRebates(CalculationRebatesDTO calculationRebatesDTO);

    /**
     * 管理端小程序-我的佣金
     *
     * @param query 查询参数
     * @return 我的拥挤
     */
    @ApiOperation(value = "管理端小程序-我的佣金")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "query", dataType = "SaleRebatesRecordQuery", value = "参数", paramType = "query")
    })
    Result<MyCommissionVO> myCommission(SaleRebatesRecordQuery query);

    /**
     * 查询对应用户绑定的用工单位
     *
     * @return 绑定的用工单位
     */
    @ApiOperation(value = "查询对应用户绑定的用工单位")
    Result<List<CompanyDO>> selectCompanyByUser();

    /**
     * 返费概览返费记录列表
     *
     * @param query 查询参数
     * @return 返费记录列表
     */
    @ApiOperation(value = "返费概览返费记录列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "query", dataType = "SaleRebatesRecordQuery", value = "参数", paramType = "query")
    })
    Result<Page<SaleRebatesRecordListVO>> rebateOverviewList(SaleRebatesRecordQuery query);

    /**
     * 返费概览分组统计
     *
     * @param query 查询参数
     * @return 统计数据
     */
    @ApiOperation(value = "返费概览返费记录列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "query", dataType = "SaleRebatesRecordQuery", value = "参数", paramType = "query")
    })
    Result<RebateOverviewGroupVO> rebateOverviewGroup(SaleRebatesRecordQuery query);

    /**
     * 返费概览月份趋势统计
     *
     * @param query 查询条件
     * @return 趋势统计
     */
    @ApiOperation(value = "返费概览返费记录列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "query", dataType = "SaleRebatesRecordQuery", value = "参数", paramType = "query")
    })
    Result<RebateOverviewMonthVO> rebateOverviewMonth(SaleRebatesRecordQuery query);
}

